// <copyright file="ICategoryRepository.cs" company="EnterpriseApi">
// Copyright (c) EnterpriseApi. All rights reserved.
// </copyright>

using EnterpriseApi.Models;

namespace EnterpriseApi.Repositories;

/// <summary>
/// 类别仓储接口，定义类别特有的数据访问操作
/// </summary>
public interface ICategoryRepository : IRepository<Category>
{
    /// <summary>
    /// 根据类别名称获取类别
    /// </summary>
    /// <param name="name">类别名称</param>
    /// <returns>类别对象，如果不存在则返回null</returns>
    Task<Category?> GetByNameAsync(string name);

    /// <summary>
    /// 检查类别名称是否已存在
    /// </summary>
    /// <param name="name">类别名称</param>
    /// <returns>类别名称是否已存在</returns>
    Task<bool> IsNameExistsAsync(string name);
}